<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_all.js"></script> 
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_config.js"></script>
<div id='message'>   
</div>
<form action="<%=basePath %>backend/addteacher" class='form-horizontal' method="post" id='teacherForm' enctype="multipart/form-data">

	<div style="padding: 20px;">
		<div class="row" style='margin-top: 10px;'>


			<div class="row ">

				<div class="control-group span7" style='height: 70px;'>
					<label class="control-label">图&nbsp;片&nbsp;上&nbsp;传:</label>
					<div class='controls'>
						<input type="file" class='form-control' name="fileste"
							id="picture" />
					</div>
				</div>

				<div class="span5" id="photo">
					<font color="red">你添加了的图片：</font> <br>
				</div>


			</div>
			<div class="row div-common"
				style='margin-top: 10px; margin-left: 100px;'>

				<div class="span5 input-prepend">
					<span class="add-on">专 业:</span> <select class="span6 " id='major'
						name='major1'>
						<option value='0'>---请选择---</option>
						<c:forEach items="${ majors}" var="major">
							<option value="${major.id }">${major.name }</option>
						</c:forEach>
					</select>

				</div>
				<div class="span5 input-prepend">
					<span class="add-on">所属研究所:</span> <select class="span6 "
						id='researchlaId' name='researchlaId1'>
						<option value='0'>---请选择（可不选）---</option>
						<c:forEach items="${ labs}" var="major">
							<option value="${major.researchlabId }">${major.researchlabName
								}</option>
						</c:forEach>
					</select>
				</div>
				<!-- Optional: clear the XS cols if their content doesn't match in height -->
				<div class="clearfix visible-xs"></div>

			</div>


			<div class="row div-common" style='margin-top: 10px;'>
				<div class="span5 input-prepend">
					<span class="add-on">所属实验室:</span> <select class="span9 "
						id='labId1' name='labId1'>
						<option value='0'>---请选择（可不选）---</option>
						<c:forEach items="${ ilabs}" var="major">
							<option value="${major.labId }">${major.labName }</option>
						</c:forEach>
					</select>
				</div>
				<div class="span5 input-prepend">
					<span class="add-on">教师姓名:</span> <input class="  "
						style='height: 20px;' name="name" type="text" />
				</div>

				<!-- Optional: clear the XS cols if their content doesn't match in height -->
				<div class="clearfix visible-xs"></div>

			</div>
			<div class="row div-common" style='margin-top: 10px;'>
				<div class="span5 input-prepend">
					<span class="add-on">电话</span> <input class="  input-medium"
						name="phone" type="text" />
				</div>
				<div class="span5 input-prepend">
					<span class="add-on">教师编号</span> <input class=" " name="no"
						type="text" />

				</div>


				<!-- Optional: clear the XS cols if their content doesn't match in height -->
				<div class="clearfix visible-xs"></div>

			</div>
			<div class='row div-common' style='margin-top: 10px;'>
				<div class=" span5 input-prepend">
					<span class="add-on">所属部门</span> <select class="span6" id='branch'
						name='branch1'>
						<option value='0'>---请选择（可不选）---</option>

						<c:forEach items="${ departments}" var="major">
							<option value="${major.dId }">${major.dName }</option>
						</c:forEach>

					</select>

				</div>
				<div class=" span5 input-prepend">
					<span class="add-on">职位</span> <select class="form-control"
						id='position' name='position'>
						<option value='0'>---请选择（可不选）---</option>
						<option value="书记">书记</option>
						<option value="主任">主任</option>
						<option value="院长">院长</option>
						<option value="副书记">副书记</option>
						<option value="副院长">副院长</option>
						<option value="分团委书记">分团委书记</option>
						<option value="副主任">副主任</option>
						<option value="组长">组长</option>
						<option value="所长">所长</option>
					</select>
				</div>
			</div>
			<div class='row div-common' style='margin-top: 10px;'>
				<div class="span5 input-prepend">
					<span class="add-on">办公地点</span> <input name="officeLocation"
						type="text" />
				</div>
				<div class="span5 input-prepend">
					<span class="add-on">Q Q</span> <input name="qq" type="text" />
				</div>

			</div>
			<div class='row'>
				<div class=" span5 control-group" style='margin-top: 10px;'>
					<label class="control-label">性别:</label>
					<div class=" controls" style='margin-top: 9px;'>
						<input class=" radio inline" type="radio" name="gender" value="男">
						男 <input class="" type="radio" name="gender" value="女"> 女
					</div>
				</div>
			</div>
			<div class='row'>
				<div class="span12 control-group" style='margin-top: 10px;'>
					<label class="control-label">类 型:</label>
					<div class=" controls" style='margin-top: 9px;'>
						<c:forEach items="${teachertypes }" var="teachertype1">
							<div class='span5 ' style='margin-left: 0px;'>
								<input class='checkbox' name='${teachertype1.tName }'
									value='${teachertype1.id }' type="checkbox">${teachertype1.tName
								}
							</div>
						</c:forEach>
					</div>
				</div>
			</div>
			<div class='row' style='margin-top: 10px;'>
				<div class="span5 control-group">
					<span class="control-label">研究方向:</span>
					<div class='controls'>
						<textarea class='text-area' name="direction"></textarea>
					</div>
				</div>
			</div>
			<div class="row" style='margin-top: 10px;'>
				<div class="span5 control-group">
					<span class="control-label"> 主要项目 : </span>
					<div class='controls'>
						<textarea style='width: 300px; height: 200px;' name="project"></textarea>
					</div>
				</div>


			</div>
			<div class='row' style='margin-top: 10px;'>
				<div class="span5 control-group">
					<span class="control-label">主要成就:</span>
					<div class='controls'>
						<textarea style='width: 300px; height: 200px;' name="achievement"></textarea>
					</div>
				</div>
			</div>



			<div class='div-common' style='margin-top: 10px;'>
				<strong>教师简介</strong><br>
				<br>
				<script id="editor"></script>
			</div>
			<input type="submit" value="完成"
				style="margin-left: 500px; margin-top: 10px;" class="btn btn-info"
				onclick="return getContent();" />
		</div>
		<input id="content1" type="hidden" name="introduce"> <input
			id='belong1' type="hidden" name='belong' />
		<!-- <input id='belong' name='belong' type="hidden" > -->
	</div>
</form>

	<script type="text/javascript">
	var ue = UE.getEditor('editor');
    function getContent() {
        var str= ue.getContent();
        $("#content1").val(str);
        var str="";
        var result = 0;
        var id="";
        $(".checkbox").each(function(){
        	if($(this).attr("checked") == true || $(this).attr("checked") == "checked")
			  {
        		
				 id+=","+$(this).val();
			  }
        });
        $("#belong1").val(id);
       // result = 0;
        return true;
    }
</script>
